//
// Copyright (C) [2024] Xingyun Integrated Circuit, Inc.
//
// GreenCode was a private technology asset of Xingyun Integrated Circuit， Inc （Confidential）
//  Author: Shawn.Tan
//  Date : 2025.10.28
//
//  History : Initial Version 2025.10.28
//
//
#ifndef Green_PyVirtualMemory_H
#define Green_PyVirtualMemory_H

#include "pybind11/pybind11.h"

#include "Generator.h"
#include "PagingInfo.h"
#include "Scheduler.h"
#include "ThreadContext.h"

namespace py = pybind11;

namespace Green {

  PYBIND11_MODULE(VirtualMemory, mod) {
    mod
      .def("getPagingMode",
        []() {
          ThreadContext thread_context;

          Scheduler* scheduler = Scheduler::Instance();
          Generator* generator = scheduler->LookUpGenerator(thread_context.GetThreadId());
          const PagingInfo* paging_info = generator->GetPagingInfo();
          return paging_info->GetPagingMode();
        })
      ;
  }

}

#endif  // Green_PyVirtualMemory_H
